<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>lwIP: HTTP client</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">lwIP
   &#160;<span id="projectnumber">2.1.2</span>
   </div>
   <div id="projectbrief">Lightweight IP stack</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__httpc.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">HTTP client<div class="ingroups"><a class="el" href="group__apps.html">Applications</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ga055b9a8bf8f4e2c18c621471773fa66c"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#ga055b9a8bf8f4e2c18c621471773fa66c">LWIP_HTTPC_HAVE_FILE_IO</a>&#160;&#160;&#160;0</td></tr>
<tr class="separator:ga055b9a8bf8f4e2c18c621471773fa66c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1f192f3009865e9f9a3cd83609c866c2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#ga1f192f3009865e9f9a3cd83609c866c2">HTTP_DEFAULT_PORT</a>&#160;&#160;&#160;<a class="el" href="group__iana.html#ggac9396d90585e49e9a287179bf5aa9ba0a1c665cb8e57dff577f4966493c15b618">LWIP_IANA_PORT_HTTP</a></td></tr>
<tr class="separator:ga1f192f3009865e9f9a3cd83609c866c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gac6713454283bff8e1187849e8d4bda18"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="group__httpc.html#ga49e34884b272b1e0ddae8da46c31d9a3">ehttpc_result</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#gac6713454283bff8e1187849e8d4bda18">httpc_result_t</a></td></tr>
<tr class="separator:gac6713454283bff8e1187849e8d4bda18"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0452eb8007dbb5f139ec992e58e560dd"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#ga0452eb8007dbb5f139ec992e58e560dd">httpc_result_fn</a>) (void *arg, <a class="el" href="group__httpc.html#gac6713454283bff8e1187849e8d4bda18">httpc_result_t</a> httpc_result, u32_t rx_content_len, u32_t srv_res, <a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> err)</td></tr>
<tr class="separator:ga0452eb8007dbb5f139ec992e58e560dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e5b62519d6592c89ed3edfabd917472"><td class="memItemLeft" align="right" valign="top">typedef <a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#ga1e5b62519d6592c89ed3edfabd917472">httpc_headers_done_fn</a>) (httpc_state_t *connection, void *arg, struct <a class="el" href="structpbuf.html">pbuf</a> *hdr, u16_t hdr_len, u32_t content_len)</td></tr>
<tr class="separator:ga1e5b62519d6592c89ed3edfabd917472"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:ga49e34884b272b1e0ddae8da46c31d9a3"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#ga49e34884b272b1e0ddae8da46c31d9a3">ehttpc_result</a> { <br />
&#160;&#160;<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3af3173d4d272c9c0b5a5c9b5b027e3659">HTTPC_RESULT_OK</a> = 0, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3a5026187026abd1d242333ba6ff69ddbd">HTTPC_RESULT_ERR_UNKNOWN</a> = 1, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3ab866d5433b4c4593c80b756d434e1d09">HTTPC_RESULT_ERR_CONNECT</a> = 2, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3ae04714f90692c122e6c85e06083dbc6d">HTTPC_RESULT_ERR_HOSTNAME</a> = 3, 
<br />
&#160;&#160;<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3a89a6700abb14dd7cab9b4e0fd66e5fd6">HTTPC_RESULT_ERR_CLOSED</a> = 4, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3a8e6c597f88335b31e6a8b078a32fde33">HTTPC_RESULT_ERR_TIMEOUT</a> = 5, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3aaa023a6f8069c02c87a826ba323c54b8">HTTPC_RESULT_ERR_SVR_RESP</a> = 6, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3a49972833ec01c7a10dee734c7c69ed62">HTTPC_RESULT_ERR_MEM</a> = 7, 
<br />
&#160;&#160;<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3adf4e45365923c16b6a6879bde5f60867">HTTPC_RESULT_LOCAL_ABORT</a> = 8, 
<a class="el" href="group__httpc.html#gga49e34884b272b1e0ddae8da46c31d9a3a6c8a4195834e1997a498a03bb47bb096">HTTPC_RESULT_ERR_CONTENT_LEN</a> = 9
<br />
 }</td></tr>
<tr class="separator:ga49e34884b272b1e0ddae8da46c31d9a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga6c961e52cec2d25b4b82b6910ebcfa1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#ga6c961e52cec2d25b4b82b6910ebcfa1b">httpc_get_file</a> (const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *server_addr, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection)</td></tr>
<tr class="separator:ga6c961e52cec2d25b4b82b6910ebcfa1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd4ef2259885a93090733235cc0fa8d6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__httpc.html#gabd4ef2259885a93090733235cc0fa8d6">httpc_get_file_dns</a> (const char *server_name, u16_t port, const char *uri, const httpc_connection_t *settings, altcp_recv_fn recv_fn, void *callback_arg, httpc_state_t **connection)</td></tr>
<tr class="separator:gabd4ef2259885a93090733235cc0fa8d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ga1f192f3009865e9f9a3cd83609c866c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1f192f3009865e9f9a3cd83609c866c2">&#9670;&nbsp;</a></span>HTTP_DEFAULT_PORT</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define HTTP_DEFAULT_PORT&#160;&#160;&#160;<a class="el" href="group__iana.html#ggac9396d90585e49e9a287179bf5aa9ba0a1c665cb8e57dff577f4966493c15b618">LWIP_IANA_PORT_HTTP</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The default TCP port used for HTTP </p>

</div>
</div>
<a id="ga055b9a8bf8f4e2c18c621471773fa66c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga055b9a8bf8f4e2c18c621471773fa66c">&#9670;&nbsp;</a></span>LWIP_HTTPC_HAVE_FILE_IO</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define LWIP_HTTPC_HAVE_FILE_IO&#160;&#160;&#160;0</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>HTTPC_HAVE_FILE_IO: define this to 1 to have functions dowloading directly to disk via fopen/fwrite. These functions are example implementations of the interface only. </p>

</div>
</div>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="ga1e5b62519d6592c89ed3edfabd917472"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e5b62519d6592c89ed3edfabd917472">&#9670;&nbsp;</a></span>httpc_headers_done_fn</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef <a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a>(* httpc_headers_done_fn) (httpc_state_t *connection, void *arg, struct <a class="el" href="structpbuf.html">pbuf</a> *hdr, u16_t hdr_len, u32_t content_len)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Prototype of http client callback: called when the headers are received</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">connection</td><td>http client connection </td></tr>
    <tr><td class="paramname">arg</td><td>argument specified when initiating the request </td></tr>
    <tr><td class="paramname">hdr</td><td>header <a class="el" href="structpbuf.html">pbuf(s)</a> (may contain data also) </td></tr>
    <tr><td class="paramname">hdr_len</td><td>length of the heders in 'hdr' </td></tr>
    <tr><td class="paramname">content_len</td><td>content length as received in the headers (-1 if not received) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>if != ERR_OK is returned, the connection is aborted </dd></dl>

</div>
</div>
<a id="ga0452eb8007dbb5f139ec992e58e560dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0452eb8007dbb5f139ec992e58e560dd">&#9670;&nbsp;</a></span>httpc_result_fn</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(* httpc_result_fn) (void *arg, <a class="el" href="group__httpc.html#gac6713454283bff8e1187849e8d4bda18">httpc_result_t</a> httpc_result, u32_t rx_content_len, u32_t srv_res, <a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> err)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Prototype of a http client callback function</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">arg</td><td>argument specified when initiating the request </td></tr>
    <tr><td class="paramname">httpc_result</td><td>result of the http transfer (see enum httpc_result_t) </td></tr>
    <tr><td class="paramname">rx_content_len</td><td>number of bytes received (without headers) </td></tr>
    <tr><td class="paramname">srv_res</td><td>this contains the http status code received (if any) </td></tr>
    <tr><td class="paramname">err</td><td>an error returned by internal lwip functions, can help to specify the source of the error but must not necessarily be != ERR_OK </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac6713454283bff8e1187849e8d4bda18"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac6713454283bff8e1187849e8d4bda18">&#9670;&nbsp;</a></span>httpc_result_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef enum <a class="el" href="group__httpc.html#ga49e34884b272b1e0ddae8da46c31d9a3">ehttpc_result</a>  <a class="el" href="group__httpc.html#gac6713454283bff8e1187849e8d4bda18">httpc_result_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>HTTP client result codes </p>

</div>
</div>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="ga49e34884b272b1e0ddae8da46c31d9a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga49e34884b272b1e0ddae8da46c31d9a3">&#9670;&nbsp;</a></span>ehttpc_result</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__httpc.html#ga49e34884b272b1e0ddae8da46c31d9a3">ehttpc_result</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>HTTP client result codes </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3af3173d4d272c9c0b5a5c9b5b027e3659"></a>HTTPC_RESULT_OK&#160;</td><td class="fielddoc"><p>File successfully received </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3a5026187026abd1d242333ba6ff69ddbd"></a>HTTPC_RESULT_ERR_UNKNOWN&#160;</td><td class="fielddoc"><p>Unknown error </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3ab866d5433b4c4593c80b756d434e1d09"></a>HTTPC_RESULT_ERR_CONNECT&#160;</td><td class="fielddoc"><p>Connection to server failed </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3ae04714f90692c122e6c85e06083dbc6d"></a>HTTPC_RESULT_ERR_HOSTNAME&#160;</td><td class="fielddoc"><p>Failed to resolve server hostname </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3a89a6700abb14dd7cab9b4e0fd66e5fd6"></a>HTTPC_RESULT_ERR_CLOSED&#160;</td><td class="fielddoc"><p>Connection unexpectedly closed by remote server </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3a8e6c597f88335b31e6a8b078a32fde33"></a>HTTPC_RESULT_ERR_TIMEOUT&#160;</td><td class="fielddoc"><p>Connection timed out (server didn't respond in time) </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3aaa023a6f8069c02c87a826ba323c54b8"></a>HTTPC_RESULT_ERR_SVR_RESP&#160;</td><td class="fielddoc"><p>Server responded with an error code </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3a49972833ec01c7a10dee734c7c69ed62"></a>HTTPC_RESULT_ERR_MEM&#160;</td><td class="fielddoc"><p>Local memory error </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3adf4e45365923c16b6a6879bde5f60867"></a>HTTPC_RESULT_LOCAL_ABORT&#160;</td><td class="fielddoc"><p>Local abort </p>
</td></tr>
<tr><td class="fieldname"><a id="gga49e34884b272b1e0ddae8da46c31d9a3a6c8a4195834e1997a498a03bb47bb096"></a>HTTPC_RESULT_ERR_CONTENT_LEN&#160;</td><td class="fielddoc"><p>Content length mismatch </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga6c961e52cec2d25b4b82b6910ebcfa1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6c961e52cec2d25b4b82b6910ebcfa1b">&#9670;&nbsp;</a></span>httpc_get_file()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> httpc_get_file </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__ipaddr.html#ga16ef96d6cde029029bbf47fee35fd67a">ip_addr_t</a> *&#160;</td>
          <td class="paramname"><em>server_addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const httpc_connection_t *&#160;</td>
          <td class="paramname"><em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">altcp_recv_fn&#160;</td>
          <td class="paramname"><em>recv_fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">httpc_state_t **&#160;</td>
          <td class="paramname"><em>connection</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>HTTP client API: get a file by passing server IP address</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">server_addr</td><td>IP address of the server to connect </td></tr>
    <tr><td class="paramname">port</td><td>tcp port of the server </td></tr>
    <tr><td class="paramname">uri</td><td>uri to get from the server, remember leading "/"! </td></tr>
    <tr><td class="paramname">settings</td><td>connection settings (callbacks, proxy, etc.) </td></tr>
    <tr><td class="paramname">recv_fn</td><td>the http body (not the headers) are passed to this callback </td></tr>
    <tr><td class="paramname">callback_arg</td><td>argument passed to all the callbacks </td></tr>
    <tr><td class="paramname">connection</td><td>retreives the connection handle (to match in callbacks) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if starting the request succeeds (callback_fn will be called later) or an error code </dd></dl>

</div>
</div>
<a id="gabd4ef2259885a93090733235cc0fa8d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabd4ef2259885a93090733235cc0fa8d6">&#9670;&nbsp;</a></span>httpc_get_file_dns()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__infrastructure__errors.html#gaf02d9da80fd66b4f986d2c53d7231ddb">err_t</a> httpc_get_file_dns </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>server_name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const httpc_connection_t *&#160;</td>
          <td class="paramname"><em>settings</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">altcp_recv_fn&#160;</td>
          <td class="paramname"><em>recv_fn</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">httpc_state_t **&#160;</td>
          <td class="paramname"><em>connection</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>HTTP client API: get a file by passing server name as string (DNS name or IP address string)</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">server_name</td><td>server name as string (DNS name or IP address string) </td></tr>
    <tr><td class="paramname">port</td><td>tcp port of the server </td></tr>
    <tr><td class="paramname">uri</td><td>uri to get from the server, remember leading "/"! </td></tr>
    <tr><td class="paramname">settings</td><td>connection settings (callbacks, proxy, etc.) </td></tr>
    <tr><td class="paramname">recv_fn</td><td>the http body (not the headers) are passed to this callback </td></tr>
    <tr><td class="paramname">callback_arg</td><td>argument passed to all the callbacks </td></tr>
    <tr><td class="paramname">connection</td><td>retreives the connection handle (to match in callbacks) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ERR_OK if starting the request succeeds (callback_fn will be called later) or an error code </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
